<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui" xmlns:cc="http://xmlns.jcp.org/jsf/composite">

    <f:view contentType="text/html">
        <h:head>
            <f:facet name="first">
                <meta content='text/html; charset=UTF-8' http-equiv="Content-Type"/>
                <title>BS_Produccion</title>
            </f:facet>
        </h:head>

        <h:body>

            <p:layout fullPage="true">
                
                <p:layoutUnit position="north" size="125" resizable="true" closable="true" collapsible="true" >
                    <A href="index.xhtml"><img src="imgs/Cabeza2.png" width="100%" height="37" alt="Cabeza"/></A>
                    <center><h3>Producción/Listado de órdenes</h3> </center>
                </p:layoutUnit>

                <p:layoutUnit position="south" size="58" closable="false" collapsible="false">
                <img src="imgs/pie.png" width="100%" height="37" alt="pie"/>                        
                </p:layoutUnit>

                <p:layoutUnit position="west" size="265" header="Left" collapsible="true">
 <h:form>
    <p:growl autoUpdate="true"/>
 
    <p:panelMenu style="width:240px">
        <p:submenu label="Producción">
            <p:submenu label="Órdenes">
                <p:submenu label="Manual">
                    <p:menuitem value="Crear" outcome="alt_pedido.xhtml" actionListener="#{menuView.delete}"/>
                    </p:submenu>    
                <p:submenu label="Automática">
                    <p:menuitem value="Configurar" outcome="config_autom.xhtml" actionListener="#{menuView.delete}"/>
                    </p:submenu>
            </p:submenu>
            <p:menuitem value="Lista órdenes" outcome="list_ord.xhtml" actionListener="#{menuView.delete}"/>
            <p:separator />
        </p:submenu>
        <p:submenu label="Cálculo">
            <p:menuitem value="Mano de Obra" outcome="calc_mo" actionListener="#{menuView.delete}"/>
            <p:menuitem value="Materiales" outcome="calc_mat.xhtml" actionListener="#{menuView.delete}"/>
            <p:menuitem value="Maquinaria" outcome="calc_maq.xhtml" actionListener="#{menuView.delete}"/>
        </p:submenu>
        <p:separator />
        <p:submenu label="Productos">
            <p:menuitem value="Listado Materiales" outcome="prod_list_mat.xhtml" actionListener="#{menuView.delete}"/>
            <p:submenu label="Productos">
                <p:menuitem value="Crear" outcome="prod_crearproducto.xhtml" actionListener="#{menuView.delete}"/>
                <p:menuitem value="Ver Catálogo" outcome="prod_catalogo_prod.xhtml" actionListener="#{menuView.delete}"/>
            </p:submenu>
        </p:submenu>
        <p:separator />
        <p:submenu label="Etiquetación" >
            <p:menuitem value="Crear e imprimir" outcome="etiq_crearimp.xhtml" actionListener="#{menuView.delete}"/></p:submenu>
        <p:submenu label="Reportes" >
            <p:menuitem value="Ver e imprimir" outcome="repor_verimpr.xhtml" actionListener="#{menuView.delete}"/>
        </p:submenu>
    </p:panelMenu>
</h:form>
                </p:layoutUnit>

                <p:layoutUnit position="center">
                    
                    
                    
                        <h:form id="form">
   <p:growl id="msgs" showDetail="true"/>
 
   <p:dataTable id="cars1" var="car" value="#{ordenesbean.lstordenes}" editable="true" style="margin-bottom:20px">
       <f:facet name="header">
           ÓRDENES
       </f:facet>
 
       <p:ajax event="rowEdit" listener="#{dtEditView.onRowEdit}" update=":form:msgs" />
       <p:ajax event="rowEditCancel" listener="#{dtEditView.onRowCancel}" update=":form:msgs" />
 
       <p:column headerText="No. Órden">
           <p:cellEditor>
               <f:facet name="output"><h:outputText value="#{ordenesbean.ordenes.noorden}" /></f:facet>
               <f:facet name="input"><p:inputText id="modelInput" value="#{car.id}" style="width:100%"/></f:facet>
           </p:cellEditor>
       </p:column>
 
       <p:column headerText="Fecha Inicio">
           <p:cellEditor>
               <f:facet name="output"><h:outputText value="#{ordenesbean.ordenes.f_inic}" /></f:facet>
               <f:facet name="input"><p:outputLabel for="popup" value="Popup:" /><p:calendar id="f_inicio" value="#{ordenesbean.ordenes.f_inic}" /></f:facet>
           </p:cellEditor>
       </p:column>
 
       <p:column headerText="Cantidad">
           <p:cellEditor>
               <f:facet name="output"><h:outputText value="#{ordenesbean.ordenes.cantidad}" /></f:facet>
               <f:facet name="input">
                   <h:outputLabel for="minMax" value="Min/Max: " />
                   <p:spinner id="minMax" value="#{ordenesbean.ordenes.cantidad}" min="0" max="100" />
               </f:facet>
           </p:cellEditor>
       </p:column>
 
       <p:column headerText="Unidad">
           <p:cellEditor>
               <f:facet name="output"><h:outputText value="#{ordenesbean.ordenes.lug_entrega}" /></f:facet>
               <f:facet name="input">
                   <h:selectOneMenu value="#{car.color}" style="width:100%">
                       <f:selectItems value="#{dtEditView.colors}" var="unidad" itemLabel="#{color}" itemValue="#{color}" />
                   </h:selectOneMenu>
               </f:facet>
           </p:cellEditor>
       </p:column>
       
       <p:column headerText="Producto">
           <p:cellEditor>
               <f:facet name="output"><h:outputText value="#{ordenesbean.ordenes.produc}" /></f:facet>
               <f:facet name="input">
                   <h:selectOneMenu value="#{car.color}" style="width:100%">
                       <f:selectItems value="#{dtEditView.colors}" var="producto" itemLabel="#{color}" itemValue="#{color}" />
                   </h:selectOneMenu>
               </f:facet>
           </p:cellEditor>
       </p:column>
       
       <p:column headerText="Fecha Entrega">
           <p:cellEditor>
               <f:facet name="output"><h:outputText value="#{ordenesbean.ordenes.f_ent}" /></f:facet>
               <f:facet name="input"><p:outputLabel for="popup" value="Popup:" /><p:calendar id="f_entrega" value="#{calendarView.date2}" /></f:facet>
           </p:cellEditor>
       </p:column>
 
       <p:column style="width:32px">
           <p:rowEditor />
       </p:column>
   </p:dataTable>
    </h:form>
                    <h:panelGrid columns="4"  cellpadding="5"><!--panel 1-->
                    <h:form>
                    <p:growl id="growl" life="2000" />    
                    <p:commandButton value="Crear" id="bt_crear" actionListener="#{buttonView.buttonAction}" update="growl" icon="ui-icon-document" />
                    </h:form>
                    
                    <h:form>
    <p:growl id="messages" />
 
    <p:splitButton value="Opciones" icon="ui-icon-clipboard">
        <p:menuitem value="Imprimir" actionListener="#{buttonView.update}" update="messages" icon="ui-icon-print" />
        <p:menuitem value="Eliminar" actionListener="#{buttonView.delete}" ajax="false" icon="ui-icon-close" />
    </p:splitButton>
</h:form>
                        <h:form>
                        <p:inputText size="10" title="Ingrese" /><p:commandButton icon="ui-icon-search" title="Buscar" type="button" />    
                        </h:form>
                        
                        </h:panelGrid>
                    
                    
                    
                </p:layoutUnit>

            </p:layout>

        </h:body>

    </f:view>
</html>
